CFLAGS := -g -O0 -Wall

log:=Thirdparty/log/log.c Thirdparty/log/log.h
log_test:Test/log_test.c $(log)
	-@gcc -o $@ $^ -I Thirdparty
	-@./$@
	-@rm $@


cJSON:=Thirdparty/cJson/cJSON.c Thirdparty/cJson/cJSON.h
cJSON_test:Test/cJson_test.c $(log) $(cJSON)
	-@gcc -o $@ $^ -I Thirdparty
	-@./$@
	-@rm $@


common:=App/app_common.c  App/app_common.h
getCurTime_test: Test/getCurTime_test.c $(log)  $(common)
	-@gcc -o  $@  $^ -IThirdparty -IApp 
	-@./$@
	-@rm $@ 

message:=App/app_message.h  App/app_message.c
app_message_test: Test/app_message_test.c  $(message) $(log) $(cJSON) $(common) 
	-@gcc -o $@ $^ -IThirdparty -IApp
	-@./$@
	-@rm $@

mqtt:=App/app_mqtt.h  App/app_mqtt.c
app_mqtt_test: Test/app_mqtt_test.c   $(log)  $(common)  $(mqtt)
	-@gcc  -o $@ $^ -IThirdparty -IApp  -lpaho-mqtt3c 
	-@./$@
	-@rm $@


pool:=App/app_pool.h  App/app_pool.c
app_pool_test: Test/app_pool_test.c  $(pool) $(log) $(common)
	-@gcc  -o $@ $^   -IThirdparty -IApp
	-@./$@
	-@rm $@


buffer:=App/app_buffer.c  App/app_buffer.h
app_buffer_test: Test/app_buffer_test.c  $(log) $(common) $(buffer)
	-@gcc  -o $@ $^   -IThirdparty -IApp 
	-@./$@
	-@rm $@

device:=App/app_device.c App/app_device.h
blue:=App/app_blue.c  App/app_blue.h
app_device_test: Test/app_device_test.c  $(log) $(common) $(buffer) $(device) $(blue) $(message) $(cJSON) $(pool) $(mqtt)
	-@gcc  -o $@ $^   -IThirdparty -IApp  -lpaho-mqtt3c
	-@./$@
	-@rm $@





